package com.ss.android.article.base.feature.feed.activity;

import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;

public class DislikeRelativeLayout extends RelativeLayout {
    private int[] a;
    private int[] b;
    private Rect c;
    private a d;
    private View e;

    public DislikeRelativeLayout(Context arg3) {
        super(arg3);
        this.a = new int[2];
        this.b = new int[2];
        this.c = new Rect();
    }

    public DislikeRelativeLayout(Context arg3, AttributeSet arg4) {
        super(arg3, arg4);
        this.a = new int[2];
        this.b = new int[2];
        this.c = new Rect();
    }

    public DislikeRelativeLayout(Context arg3, AttributeSet arg4, int arg5) {
        super(arg3, arg4, arg5);
        this.a = new int[2];
        this.b = new int[2];
        this.c = new Rect();
    }

    public final void a(View arg1) {
        if (arg1 != null) {
            this.e = arg1;
        }
    }

    public boolean onInterceptTouchEvent(MotionEvent arg8) {
        boolean v2_1;
        boolean v0 = false;
        int v2 = ((int) arg8.getX());
        int v3 = ((int) arg8.getY());
        if (this.c != null) {
            View v4 = this.e;
            if (v4 == null) {
                v2_1 = false;
            } else {
                this.getLocationOnScreen(this.a);
                v4.getLocationOnScreen(this.b);
                v2 -= this.b[0] - this.a[0];
                v3 -= this.b[1] - this.a[1];
                this.c.set(0, 0, v4.getWidth(), v4.getHeight());
                v2_1 = this.c.contains(v2, v3);
            }

            if (!v2_1) {
                if (this.d != null) {
                    this.d.a();
                }
                return true;
            }
        } else {
            label_36:
            if (this.d != null) {
                this.d.a();
            }

            v0 = true;
        }

        return v0;
    }

    public void setCallback(a arg1) {
        this.d = arg1;
    }

    public interface a {
        void a();
    }
}

